﻿<mui:ModernWindow x:Class="Vtron.HipcConfigurationTools.VWASStyle.SetTimeWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mui="http://firstfloorsoftware.com/ModernUI"
        Title="设置时间" Height="300" Width="400"
        WindowStartupLocation="CenterScreen">

    <mui:ModernWindow.Resources>
        <Style x:Key="TextBlockStyle" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Right"/>
            <Setter Property="Margin" Value="0,0,5,0"/>
            <Setter Property="FontSize" Value="13.333"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style x:Key="TextBoxStyle" TargetType="TextBox">
            <Setter Property="Width" Value="350"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="5,3,0,3"/>
            <Setter Property="BorderThickness" Value="0,0,0,1"/>
            <Setter Property="BorderBrush" Value="Black"/>
            <Setter Property="Background" Value="{x:Null}"/>
        </Style>

    </mui:ModernWindow.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock Text="设置设备名" Margin="20,20,40,8" FontSize="18"/>
        <Grid Grid.Row="1" Margin="20">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Text="时间源：" Style="{StaticResource TextBlockStyle}"/>
            <StackPanel Orientation="Horizontal"  Grid.Row="0" Grid.Column="1">
                <RadioButton x:Name="rtc_RadioButton" GroupName="Signal" Margin="5,0,0,0" VerticalAlignment="Center" IsChecked="True" Click="rtc_RadioButton_Click" >RTC</RadioButton>
                <RadioButton x:Name="ntp_RadioButton" GroupName="Signal" Margin="5,0,0,0" VerticalAlignment="Center" Click="ntp_RadioButton_Click" >NTP</RadioButton>
            </StackPanel>
            <Line Grid.Row="0" Grid.ColumnSpan="2" Height="1" Stretch="Fill" X2="1" Stroke="#cccccc" StrokeDashArray="1, 1"  StrokeThickness="2" Margin="0,40,0,5" />
            
            <Grid x:Name="rtc_Grid" Grid.Row="1" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="日期：" Style="{StaticResource TextBlockStyle}"/>
                <DatePicker Name="datePicker" Margin="5,6,0,3" FontSize="14" Width="100"  Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left"/>
                <TextBlock Text="时：" Style="{StaticResource TextBlockStyle}" Grid.Row="1" Grid.Column="0"/>
                <ComboBox x:Name="hour_ComboBox" Margin="5,3,0,3" HorizontalAlignment="Left" MinWidth="100" IsEditable="True" Grid.Row="1" Grid.Column="1"/>
                <TextBlock Text="分：" Style="{StaticResource TextBlockStyle}" Grid.Row="2" Grid.Column="0"/>
                <ComboBox x:Name="min_ComboBox" Margin="5,3,0,3" HorizontalAlignment="Left" MinWidth="100" IsEditable="True" Grid.Row="2" Grid.Column="1"/>
                <TextBlock Text="秒：" Style="{StaticResource TextBlockStyle}" Grid.Row="3" Grid.Column="0"/>
                <ComboBox x:Name="sec_ComboBox" Margin="5,3,0,3" HorizontalAlignment="Left" MinWidth="100" IsEditable="True" Grid.Row="3" Grid.Column="1"/>
                <StackPanel Grid.Column="1" Orientation="Horizontal" Grid.Row="4" Margin="5,20">
                    <Button Content="取消" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="CancelButton_Click"/>
                    <Button Content="设置" VerticalAlignment="Center" Width="87" Height="26" FontSize="12.333" Click="SubmitButton_Click"/>
                </StackPanel>
            </Grid>

            <Grid x:Name="ntp_Grid" Grid.Row="1" Grid.ColumnSpan="2" Visibility="Collapsed">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <TextBlock Text="NTP地址：" Style="{StaticResource TextBlockStyle}"/>
                <TextBox Name="ip_TextBox"  Style="{StaticResource TextBoxStyle}" Grid.Row="0" Grid.Column="1"/>
                <TextBlock Text="间隔周期（秒） ：" Style="{StaticResource TextBlockStyle}" Grid.Row="1" Grid.Column="0"/>
                <TextBox Name="cycleSec_TextBox" Style="{StaticResource TextBoxStyle}"  Grid.Row="1" Grid.Column="1"/>
                <TextBlock Text="端口：" Style="{StaticResource TextBlockStyle}" Grid.Row="2" Grid.Column="0"/>
                <TextBox Name="port_TextBox" Style="{StaticResource TextBoxStyle}"  Grid.Row="2" Grid.Column="1"/>
                <StackPanel Grid.Column="1" Orientation="Horizontal" Grid.Row="3" Margin="5,20">
                    <Button Content="取消" VerticalAlignment="Center" Width="97" Height="26" FontSize="12.333" Click="CancelButton_Click"/>
                    <Button Content="设置" VerticalAlignment="Center" Width="87" Height="26" FontSize="12.333" Click="SubmitButton_Click"/>
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
</mui:ModernWindow>
